/******************************************************************************
 *  Author:     Williams, Jacob (williamsj@msoe.edu)
 *  Class:      CE-3910
 *  Instructor: Dr. Barnekow
 *****************************************************************************/
#ifndef SERVO_H
#define SERVO_H

#include <stdint.h>

#define MAX_TILT 120
#define MIN_TILT 50
#define MAX_PAN 165
#define MIN_PAN 5

/**
 * Initializes the Servos. This includes setting the Pins on PORTD used for
 * output and setting up Timer 1 for PWN generation
 */
void initServo(void);

/**
 * Gets the current Pan angle
 * @return The current pan angle in degrees
 */
uint8_t getPan();

/**
 * Gets the current Tilt angle
 * @return the current tilt angle in degrees
 */
uint8_t getTilt();

/**
 * Sets the angle that the camera is panned to. This value will be restricted
 * to be between MAX_PAN and MIN_PAN
 * @param angle The new angle to set the pan to
 */
void setPan(uint8_t angle);

/**
 * Sets the angle that the camera is tilted to. This value will be restricted
 * to be between MAX_TILT and MIN_TILT
 * @param angle The new angle the tilt will be set to.
 */
void setTilt(uint8_t angle);

#endif
